'use strict';

(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('waf.test.pti.complexTableController', complexTableController);
	complexTableController.$inject = [ '$scope', '$q', 'Constants', 'gridService', 'modalService', 'layoutConfig', 'validatorConfig', 'authService' ];
	function complexTableController($scope, $q, Constants, gridService, modalService, layoutConfig, validatorConfig, authService) {
		var ctrl = this, log = $scope.loggerFactory.getLogger("groupTableController");
		ctrl.validatorConfig = validatorConfig;
		ctrl.layoutConfig = {
			P : {
				"layout" : {
					"group" : {
						"grids" : [ "column1", "column2", "column3", "column4" ]
					}
				},
				"gridConfig": {
					"column1": {
						"label": "P Column1",
						"model": "column1",
						"type": "text",
						"size": 4,
						"placeholder": "P Column1 Placeholder",
						"tooltip": "P Column1 Tooltip"
					},
					"column2": {
						"label": "P Column2",
						"model": "column2",
						"type": "text",
						"size": 4,
						"placeholder": "P Column2 Placeholder",
						"tooltip": "P Column2 Tooltip"
					},
					"column3": {
						"label": "P Column3",
						"model": "column3",
						"type": "text",
						"size": 4,
						"placeholder": "P Column3 Placeholder",
						"tooltip": "P Column3 Tooltip"
					},
					"column4": {
						"label": "P Column4",
						"model": "column4",
						"type": "text",
						"size": 4,
						"placeholder": "P Column4 Placeholder",
						"tooltip": "P Column4 Tooltip"
					}
				}
			},
			I : {
				"layout" : {
					"group" : {
						"grids" : [ "column1", "column2", "column3", "column4" ]
					}
				},
				"gridConfig": {
					"column1": {
						"label": "I Column1",
						"model": "column1",
						"type": "text",
						"size": 4,
						"placeholder": "I Column1 Placeholder",
						"tooltip": "I Column1 Tooltip"
					},
					"column2": {
						"label": "I Column2",
						"model": "column2",
						"type": "text",
						"size": 4,
						"placeholder": "I Column2 Placeholder",
						"tooltip": "I Column2 Tooltip"
					},
					"column3": {
						"label": "I Column3",
						"model": "column3",
						"type": "text",
						"size": 4,
						"placeholder": "I Column3 Placeholder",
						"tooltip": "I Column3 Tooltip"
					},
					"column4": {
						"label": "I Column4",
						"model": "column4",
						"type": "text",
						"size": 4,
						"placeholder": "I Column4 Placeholder",
						"tooltip": "I Column4 Tooltip"
					}
				}
			},
			F : {
				"layout" : {
					"group" : {
						"grids" : [ "column1", "column2", "column3", "column4" ]
					}
				},
				"gridConfig": {
					"column1": {
						"label": "F Column1",
						"model": "column1",
						"type": "text",
						"size": 4,
						"placeholder": "F Column1 Placeholder",
						"tooltip": "F Column1 Tooltip"
					},
					"column2": {
						"label": "F Column2",
						"model": "column2",
						"type": "text",
						"size": 4,
						"placeholder": "F Column2 Placeholder",
						"tooltip": "F Column2 Tooltip"
					},
					"column3": {
						"label": "F Column3",
						"model": "column3",
						"type": "text",
						"size": 4,
						"placeholder": "F Column3 Placeholder",
						"tooltip": "F Column3 Tooltip"
					},
					"column4": {
						"label": "F Column4",
						"model": "column4",
						"type": "text",
						"size": 4,
						"placeholder": "F Column4 Placeholder",
						"tooltip": "F Column4 Tooltip"
					}
				}
			}
		};

		ctrl.init = function() {
			ctrl.data = [ {
				type : 'P',
				column1 : 'P1',
				column2 : 'P2',
				column3 : 'P3',
				column4 : 'P4'
			}, {
				type : 'I',
				id:1,
				parent:1,
				column1 : '100',
				column2 : 'I2',
				column3 : 'I3',
				column4 : 'I4'
			}, {
				type : 'I',
				id:2,
				parent : 1,
				column1 : 'I1',
				column2 : 'I2',
				column3 : 'I3',
				column4 : 'I4'
			}, {
				type : 'F',
				column1 : 'F1',
				column2 : 'F2',
				column3 : 'F3',
				column4 : 'F4'
			} ];
		};
	}
})(angular);